package com.endlessblue.visa.vo;


/**
 * 系统缓存类型定义
 * @author sonta
 *
 */
public enum CacheType{
	
	SESSION_CACHE("sessionCache", "session缓存", "通用"),
	AUTH_CODE_CACHE("authCodeCache", "验证码缓存", "通用");
	
	private String code;
	
	private String memo;
	
	private String owner;

	private CacheType (String code, String memo, String owner) {
		this.code = code;
		this.memo = memo;
		this.owner = owner;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}
	
	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}
	
	public static CacheType getCode(String code) {
		for (CacheType c : CacheType.values()) {
			if (c.getCode().equals(code)) {
				return c;
			}
		}
		return null;
	}
}
